#include "poj.h"
#include "gvj.h"
#include <string.h>

const char* Poj::oj_name = "poj";

const char* Poj::url_home = "http://poj.org";	
const char* Poj::url_login = "http://poj.org/login";
const char* Poj::url_submit = "http://poj.org/submit";

// 描述OJ评判结果（状态）
const int Poj::n_language = 7;
const int Poj::n_status_header = 9;
const int Poj::n_finish_status = 8;
const int Poj::n_wait_status = 3;
const int Poj::n_error_status = 2;

const char Poj::poj_language[][10] = {"G++", "GCC", "Java", "Pascal", "C++", "C", "Fortran"};
const char Poj::poj_status_header[][20] = {"Run ID", "User", "Problem", "Result", "Memory", "Time", "Language", "Code Length", "Submit Time"};
const char Poj::poj_finish_status[][30] = {"Accepted", "Presentation Error", "Time Limit Exceeded", "Memory Limit Exceeded", "Wrong Answer", "Runtime Error", "Output Limit Exceeded", "Compile Error"};
const char Poj::poj_wait_status[][20] = {"Waiting", "Compiling", "Running & Judging"};
const char Poj::poj_error_status[][30] = {"System Error", "Validator Error"};
// 描述OJ评判结果（状态）

const char* Poj::get_oj_name() {
	return Poj::oj_name;
}

bool Poj::check_language(const char *str) {
	char item[20];
	for (int i = 0; i < n_language; i++) {
		strcpy(item, poj_language[i]);
		if (!strcmp(str, strlower(item))) 
				return true;
	}
	return false;
}
